const TOKEN_TIME = 'tokenTime';

const TOKEN_TIME_VALUE =  24 * 60 * 60 * 1000;

export const setTokenTime = () => {
    localStorage.setItem(TOKEN_TIME, Date.now())

}

export const getTokenTime = () => {
    return localStorage.getItem(TOKEN_TIME)

}

export const diffTokenTime = () => {
    const current = Date.now()
    const loginTime = getTokenTime()
    return current - loginTime > TOKEN_TIME_VALUE
}